<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAgentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agent', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('grid_id')->default(0)->comment('网格id');
            $table->string('name', 100)->default('')->comment('姓名');
            $table->string('identity_card', 100)->default('')->comment('身份证号');
            $table->integer('id_obverse_img')->default(0)->comment('身份证正面');
            $table->integer('id_reverse_img')->default(0)->comment('身份证反面');
            $table->string('phone', 60)->default('')->comment('手机号');
            $table->timestamps();
            $table->softDeletes();
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `agent` comment '代理人表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agent');
    }
}
